package bairui.international.console.web.controller.delicate.category.product;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.ResponseBody;

import com.lianjing.sh.project.commons.util.Util_FileDeal;
import com.lianjing.sh.spring.web.controller.base.action.Action;
import com.lianjing.sh.spring.web.controller.enhance.output.FomatOutput;

import bairui.international.model.domain.jpa.TB_ProductRollImage;
import bairui.international.service.Service_ProductRollImage_Generate;

/**
 *
 * 产品滚动图片管理
 *
 * @generated
 * 
 * @see STest_C_Delicate_Category_ProductRollUpload_Delete 测试
 *
 */
@Controller
public class C_Delicate_Category_ProductRollUpload_Delete
 extends SC_Delicate_Category_ProductRollUpload_Delete 
{
	
	@Autowired private Service_ProductRollImage_Generate service_ProductRollImage_Generate;
	
	/**
	 * 删除
	 */
	@Action(Delete.class)
	@DeleteMapping(Delete.RequestMappingValue)
	public @FomatOutput @ResponseBody Object delete(
		@PathVariable(name=Delete.PathVariableName.CategoryId) long categoryId, 
		@PathVariable(name=Delete.PathVariableName.Id) long id, 
		@PathVariable(name=Delete.PathVariableName.ImgId) long imgId
	) throws Exception {
		TB_ProductRollImage bean = service_ProductRollImage_Generate.findDeleteById(imgId);
		Util_FileDeal.deleteFile(bean.getFileUrl(), pathConfig.getPosition_Image_ProductRollImage());
		return null;
	}
	

}
